<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<SCRIPT type=text/javascript src="plug-in/clipboard/ZeroClipboard.js"></SCRIPT>


<script>
	function addForm(title, url, id) {
		gridname = id;
		createwindow(title, url, 900, 500);
	}
	function updateForm(title, url, id) {
		gridname = id;
		var rowsData = $('#' + id).datagrid('getSelections');
		if (!rowsData || rowsData.length == 0) {
			tip('请选择编辑项目');
			return;
		}
		if (rowsData.length > 1) {
			tip('请选择一条记录再编辑');
			return;
		}
		createwindow(title, url + '&id=' + rowsData[0].id, 1150, 600);

	}
</script>

<div class="easyui-layout" fit="true">
	<div region="center" style="padding: 1px;">
		<t:datagrid sortName="createDate" sortOrder="desc" name="metadata" title="智能表单配置"
			fitColumns="false" actionUrl="metadataController.do?datagrid" idField="id" fit="true"
			queryMode="group" checkbox="true">
			<t:dgCol title="编号" field="id" hidden="false"></t:dgCol>
			<t:dgCol title="元数据编码" field="code" query="true"></t:dgCol>
			<t:dgCol title="元数据名称" field="name" query="true"></t:dgCol>
			<t:dgCol title="引用表名" field="refTable" query="true" autocomplete="true" />
			<t:dgToolBar title="新增" icon="icon-add" width="900" height="600"
				url="metadataController.do?addOrEdit" funname="addForm"></t:dgToolBar>
			<t:dgToolBar title="修改" icon="icon-edit" width="900" height="600"
				url="metadataController.do?addOrEdit" funname="updateForm"></t:dgToolBar>
			<t:dgToolBar title="删除" icon="icon-edit" url="metadataController.do?delete"
				funname="cgFormButton"></t:dgToolBar>
		</t:datagrid>
	</div>
	
	
</div>
